﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ScaleComponent : MonoBehaviour {


    [SerializeField] GameObject[] showGameObjects;
    [SerializeField] GameObject[] hideGameObjects;


    public void Show ()
    {
        foreach (var item in showGameObjects)
        {
            item.SetActive(true);
        }
        foreach (var item in hideGameObjects)
        {
            item.SetActive(false);
        }
    }

    public void Over ()
    {
        foreach (var item in showGameObjects)
        {
            item.SetActive(false);
        }
        foreach (var item in hideGameObjects)
        {
            item.SetActive(true);
        }
        StartCoroutine(ScrollViewReposition());
    }
    private IEnumerator ScrollViewReposition()
    {
        //  yield return new WaitForSeconds(0.1f);
        yield return new WaitForEndOfFrame();
        if (TransformScaleBox.Thas.Over != null)
        {
            TransformScaleBox.Thas.Over();
        }
        TransformScaleBox.Thas.MyOver();
    }
}
